#ifndef __WPTH_PAGECONTAINER_H__
#define __WPTH_PAGECONTAINER_H__

#include "defs.h"

WX_DECLARE_OBJARRAY(wxWindow*, PageArray);

class PageContainer
{
public:
	PageContainer();
	virtual ~PageContainer();

	bool AddPage(wxWindow* page);
	bool InsertPage(wxWindow* page, size_t idx);
	bool MovePage(wxWindow* page, size_t new_idx);
	bool RemovePage(wxWindow* page);
	bool SetActivePage(wxWindow& page);
	bool SetActivePage(size_t page);
	inline void SetNoneActive();
	int GetActivePage() const { return m_active; }
	wxWindow* GetWindowFromIdx(size_t idx) const;
	int GetIdxFromWindow(wxWindow* page) const;
	size_t GetPageCount() const { return m_pages.GetCount(); }
	wxWindow* GetPage(size_t idx) { return GetWindowFromIdx(idx); }
	PageArray& GetPages() { return m_pages; }

	void DoShowHide();
	void SetRect(const wxRect& rect);

protected:
	PageArray m_pages;
	wxRect m_rect;
	int m_active;
};

#endif